#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include <QWidget>
#include <QLineEdit>
#include <QLabel>
#include <QPushButton>
#include "verifycodewidget.h"

class LoginWidget : public QWidget
{
    Q_OBJECT
public:
    explicit LoginWidget(QWidget *parent = nullptr);

    // 这个函数用来 "切换模式" , 把登录模式切换成注册, 注册切换成登录
    void switchMode();
    void clickSubmitBtn();
    void userRegisterDone(bool ok, const QString& reason);
    void userLoginDone(bool ok, const QString& reason);


private:
    bool isLoginMode = true;

    //输入用户名框
    QLineEdit* usernameEdit;
    //输入密码框
    QLineEdit* passwordEdit;
    //输入验证码框
    QLineEdit* verifyCodeEdit;

    //标题
    QLabel* titleLabel;
    //登陆 注册按钮
    QPushButton* submitBtn;
    //手机号登陆 手机号注册按钮
    QPushButton* phoneModeBtn;
    //注册按钮
    QPushButton* switchModeBtn;
    // 验证码
    VerifyCodeWidget* verifyCodeWidget;

signals:
};

#endif // LOGINWIDGET_H
